﻿using Store.WP7.Controls;
using Store.WP7.Framework.Animations;
using System.Windows.Threading;
using System;
using Store.WP7.ViewModels;
using Store.WP7.Framework.Interactions;
using Microsoft.Phone.Shell;

namespace Store.WP7.Views
{
    public partial class ProductDetailsView : StoreApplicationPage
    {
        private ProductDetailsViewModel _viewModel;

        public ProductDetailsView()
        {
            InitializeComponent();

            Loaded += (s, e) =>
            {
                _viewModel = DataContext as ProductDetailsViewModel;
            };
        }

        private void BasketAppBarIconButton_Click(object sender, EventArgs e)
        {
            if (_viewModel != null)
            {
                _viewModel.GoToBasketView();
            }
        }
    }
}